$(function() {
    var grid = $("#gridCustomerBusiness").datagrid({
        iconCls: "icon-save",
        methord: "post",
        url: "/Main/GetChargingList",
		queryParams: {
		customerid: $("#ID").val()},
		sortName: "ID",
        sortOrder: "desc",
        idField: "ID",
        pageSize: 20,
        striped: true, //奇偶行是否区分
        columns: [[
					{ field: "ChargingMoney", title: "交款金额" },
                    { field: "PayMethod", title: "交款方式", formatter: function(value, row, index) {
							var name = "";
							$.ajax({
								url: "/main/GetMethodName?id=" + value,
								type: "post",
								async: false,
								success: function(re){
									var data = eval("(" + re + ")");
									name=data.MethodName;
								}
							});
							return name;
						}},
                    { field: "ChargingDate", title: "交款日期", formatter: $.getJsonDate}
				]],

        rownumbers: true,
        fitColumns: true,
		onLoadError: function(data, status, error){
			if(data.status == "400")
				indexPage.reLogin();
		}
    });
});